<?php /*a:1:{s:73:"D:\web\wwwroot\tp5.1\public/../app/admin\view\game_center\noticeinfo.html";i:1526481896;}*/ ?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>表单</title>
    <link rel="stylesheet" href="/static/frame/layui/css/layui.css">
    <link rel="stylesheet" href="/static/frame/static/css/style.css">
    <link rel="icon" href="/static/frame/static/image/code.png">
</head>
<body class="body">
<?php if(ahuthbtn('addnotice')): ?>
<a class="layui-btn site-demo-active layui-btn-sm" id="addview" data-href="<?php echo url('admin/GameCenter/addnotice',['id'=>$id]); ?>"><i class="layui-icon layui-icon-add-circle"></i>添加游戏公告</a>
<?php endif; ?>
<div class="search">
  <form class="layui-form" action="">
<!--        <div class="layui-input-inline top-search-date">
        <input type="text" name="searchdate" id="date1" autocomplete="off"  class="layui-input layui-input-sm" placeholder=" 开始时间 - 结束时间" value="<?php echo htmlentities($searchdate); ?>">
      </div>   -->
        <div class="layui-input-inline">
        <select name="search" lay-verify="required" class="search-name" lay-search="">
          <option value="version" <?php echo $search=='version' ? 'selected=""'  :  ''; ?>>公告版本号</option>
        </select>
        <input type="hidden" name="id" value="<?php echo htmlentities($id); ?>">
      </div>
  <div class="layui-inline">
    <input class="layui-input layui-input-sm" name="val" placeholder="请输入" id="search-elm" autocomplete="off" value="<?php echo htmlentities($val); ?>">
  </div>
  <button class="layui-btn site-demo-active layui-btn-sm search-btn" data-type="reload">搜索</button>
</form>
</div>
</div>

<div class="system-table-1 layui-clear" style="padding-top:10px;">

<table class="layui-table" lay-filter="parse-table-demo" lay-data="{height:'full-120',url:'<?php echo url('admin/GameCenter/ajaxnoticeinfo',Request::param()); ?>', page:true, id:'test',limit:'<?php echo config('webconfig.page'); ?>'}">
  <thead>
    <tr>
      <th lay-data="{field:'id', width:80, sort: true}">ID</th>
      <th lay-data="{field:'version', width:120}">公告版本号</th>
      <th lay-data="{field:'notice', minwidth:180}">服务器公告</th>
	  <th lay-data="{field:'update_time', width:180}">时间</th>
	  <th lay-data="{fixed: 'right', width:128, align:'center',toolbar:'#barDemo'}">操作</th>
    </tr> 
  </thead>
</table>
<script type="text/html" id="barDemo">
  <a class="layui-btn layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i></a>
  <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i></a>
</script>
</div>
<!-- 通用-970*90 -->
<script src="/static/frame/layui/layui.js" charset="utf-8"></script>
<script src="/static/admin/js/comm.js" charset="utf-8"></script>
<script type="text/javascript">
layui.use(['form', 'table', 'laydate'], function() {
    var $ = layui.jquery,
        form = layui.form,
        laydate = layui.laydate,
        table = layui.table;

//日期时间范围
      laydate.render({
        elem: '#date1',
        type: 'datetime',
        range: true
      });

//添加
    $('#addview').click(function(){
      layer.open({
        title: "添加游戏公告",
        type: 2,
        area: ['450px', '500px'],
        fixed: false, //不固定
        maxmin: true,
        content: $(this).attr('data-href')
      });
    });

  //监听工具条
  table.on('tool(parse-table-demo)', function(obj){
    var data = obj.data;
    if(obj.event === 'del'){
      layer.confirm('真的删除行么', function(index){
        $.get("<?php echo url('admin/GameCenter/delnotice'); ?>?id=<?php echo htmlentities($id); ?>&nid=" + data.id,function(data){
        if (data.code == 1) {
          layer.msg(data.msg);
          obj.del();
          layer.close(index);
        }
        });
        // window.location.href='<?php echo url('delete','',false); ?>/id/'+data.id ;
        // obj.del();
        // layer.close(index);
      });
    } else if(obj.event === 'edit'){

      layer.open({
        title: "修改游戏公告",
        type: 2,
        area: ['450px', '500px'],
        fixed: false, //不固定
        maxmin: true,
        content: "<?php echo url('admin/GameCenter/editnotice'); ?>?id=<?php echo htmlentities($id); ?>&nid=" + data.id
      });

      //window.location.href='<?php echo url('edit','',false); ?>/id/'+data.id ;
      //layer.alert('编辑行：<br>'+ data.id)
    }
  });





});
</script>



</body>
</html>